package com.codi.jobservice.job;

import com.codi.base.spring.SpringContextHolder;
import com.codi.bus.core.service.MessageService;
import com.codi.bus.core.service.TradeSyncService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * 模块名
 *
 * @author spy
 * @version 1.0 2017-12-21 11:14
 * @since 1.0
 */
@Slf4j
@DisallowConcurrentExecution
public class TradeStatusSyncJob extends QuartzJobBean {


    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        log.info("trade status sync");

        TradeSyncService tradeSyncService = SpringContextHolder.getBean(TradeSyncService.class);
        MessageService messageService = SpringContextHolder.getBean(MessageService.class);
        tradeSyncService.syncHundsun();
        messageService.getPortfolioFundMessage();
    }
}
